/*
 * AllegroException.cpp
 *
 *  Created on: 08/12/2008
 *      Author: fernando
 */

#include "AllegroException.h"
#include <sstream>

using std::stringstream;

namespace core {

const char* AllegroException::_id = "core::AllegroException";

AllegroException::AllegroException() throw() :
	Exception(_id) {

}

AllegroException::AllegroException(const char* what) throw() :
	Exception(_id, what) {

}

AllegroException::AllegroException(const char* what, const char* cause) throw() :
	Exception(_id, what, cause) {

}

AllegroException::AllegroException(int allegro_error_code) throw() :
	Exception(_id) {
	stringstream ss;
	ss << "Allegro error code: " << allegro_error_code;
	_what = ss.str().c_str();
}

AllegroException::AllegroException(int allegro_error_code, const char* cause) throw() :
	Exception(_id, 0, cause) {
	stringstream ss;
	ss << "Allegro error code: " << allegro_error_code;
	_what = ss.str().c_str();
}

AllegroException::~AllegroException() throw() {
}

}
